home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 September / Chip_2002-09_cd1.bin / sharewar / slunec / app / httrack.exe / {app} / src_win / WinHTTrack / Shell.h < prev    next >
C/C++ Source or Header  |  2002-05-16  |  6KB  |  224 lines

  1. // Shell.h : main header file for the SHELL application
  2. //
  3.  
  4. #if !defined(AFX_SHELL_H__ED81E637_E017_11D1_A97E_006097BC6150__INCLUDED_)
  5. #define AFX_SHELL_H__ED81E637_E017_11D1_A97E_006097BC6150__INCLUDED_
  6. #if _MSC_VER >= 1000
  7. #pragma once
  8. #endif // _MSC_VER >= 1000
  9. #ifndef __AFXWIN_H__
  10.     #error include 'stdafx.h' before including this file for PCH
  11. #endif
  12.  
  13. /* basic HTTrack defs */
  14. extern "C" {
  15.   #include "htsglobal.h"
  16.   #include "htsopt.h"
  17. }
  18.  
  19. // Site actuel de HTTrack
  20. #define HTTRACK_WEB "http://www.httrack.com"
  21.  
  22. //
  23. // connectΘ via HTTrack? (dΘfini dans projet)
  24. #define USE_RAS 1
  25. //
  26.  
  27. // sleep (taux de refresh) en ms
  28. #define HTS_SLEEP_WIN 100
  29.  
  30. #include "resource.h"       // main symbols
  31. #include "cpp_lang.h"
  32. // Ras
  33. #if USE_RAS
  34. #include "RasLoad.h"
  35. #endif
  36. #include "MainTab.h"
  37.  
  38. // helper launcher
  39. #include "LaunchHelp.h"
  40.  
  41. // lang.h
  42. #include "newlang.h"
  43.  
  44. // message requests
  45. #define wm_ViewRestart (WM_USER + 100)
  46. // test 
  47. #define wm_WizRequest1 (WM_USER + 101)
  48. #define wm_WizRequest2 (WM_USER + 102)
  49. #define wm_WizRequest3 (WM_USER + 103)
  50.  
  51. // char[] dynamiques
  52. #define dynstrcpy(dest,src) { \
  53.   if (dest) free(dest);\
  54.   dest=(char*) malloc(strlen(src)+1);\
  55.   if (dest)\
  56.     strcpy(dest,src);\
  57.   }
  58. #define dynclear(dest) { if (dest) { free(dest); dest=NULL; }}
  59.  
  60. typedef struct {
  61.   char nom[1000];
  62.   char fichier[256];
  63.   char etat[20];
  64.   char url_sav[HTS_URLMAXSIZE*2];    // pour cancel
  65.   char url_adr[HTS_URLMAXSIZE*2];
  66.   char url_fil[HTS_URLMAXSIZE*2];
  67.   LLint size;
  68.   LLint sizetot;
  69.   int offset;
  70.   //
  71.   int back;
  72.   //
  73.   int actived;    // pour disabled
  74. } t_StatsBuffer;
  75.  
  76. typedef struct {
  77.   int ask_refresh;
  78.   int refresh;
  79.   LLint stat_bytes;
  80.   int stat_time;
  81.   int lien_n;
  82.   int lien_tot;
  83.   int stat_nsocket;
  84.   int rate;
  85.   int irate;
  86.   int ft;
  87.   LLint stat_written;
  88.   int stat_updated;
  89.   int stat_errors;
  90.   int stat_warnings;
  91.   int stat_infos;
  92.   TStamp stat_timestart;
  93.   int stat_back;
  94. } InpInfo;
  95.  
  96.  
  97. /* WinHTTrack mutex */
  98. extern HANDLE WhttMutex;
  99. #define WHTT_LOCK() WaitForSingleObject(WhttMutex,INFINITE)
  100. #define WHTT_UNLOCK() ReleaseMutex(WhttMutex)
  101.  
  102. /* Location */
  103. extern char* WhttLocation;
  104. #define WHTT_LOCATION(a) WhttLocation=(a)
  105.  
  106. // fonctions moteur
  107. int   __cdecl httrackengine_check(char* adr,char* fil,int status);
  108. void  __cdecl httrackengine_init();
  109. void  __cdecl httrackengine_uninit();
  110. int   __cdecl httrackengine_start(void* dummy);
  111. int   __cdecl httrackengine_end();
  112. int   __cdecl httrackengine_htmlcheck(char* html,int len,char* url_adresse,char* url_fichier);
  113. int   __cdecl httrackengine_chopt(void* opt);
  114. int   __cdecl httrackengine_loop(void* _back,int back_max,int back_index,int lien_n,int lien_tot,int stat_time,hts_stat_struct* stats);
  115. char* __cdecl httrackengine_query(char* question);
  116. char* __cdecl httrackengine_query2(char* question);
  117. char* __cdecl httrackengine_query3(char* question);
  118. void  __cdecl httrackengine_pause(char* lockfile);
  119.  
  120.  
  121. // profile
  122. int Save_current_profile(int ask);
  123. //
  124. int MyGetProfileInt(CString path,CString dummy,CString name,int value);
  125. int MyGetProfileIntFile(FILE* fp,CString dummy,CString name,int value);
  126. int MyWriteProfileString(CString path,CString dummy,CString name,CString value);
  127. int MyWriteProfileStringFile(FILE* fp,CString dummy,CString name,CString value);
  128. CString MyGetProfileStringFile(FILE* fp,CString dummy,CString name,CString value);
  129. CString MyGetProfileString(CString path,CString dummy,CString name,CString value="");
  130. void Write_profile(CString path,int load_path);
  131. void Read_profile(CString path,int load_path);
  132. int MyWriteProfileInt(CString path,CString dummy,CString name,int value);
  133. int MyWriteProfileIntFile(FILE* fp,CString dummy,CString name,int value);
  134.  
  135. void Build_TopIndex(BOOL check_empty=TRUE);
  136.  
  137. void InitRAS();
  138.  
  139. // Gestion rΘpertoires
  140. int CheckDirInfo(CString path);
  141. BOOL RemoveEmptyDir(CString path);
  142.  
  143.  
  144. // RAS //
  145. /*
  146. #include "Ras.h"
  147. typedef unsigned long (* t_RasHangUp)(HRASCONN);
  148. */
  149. // RAS END //
  150.  
  151. /* lang extensions */
  152. void SetCombo(CWnd* _this,int id,char* lang_string);
  153.  
  154.  
  155. // HTTrack params - pour le multithread interface/robot
  156. class HTTrack_Params {
  157. public:
  158.   int argc;
  159.   char** argv;
  160.   //
  161.   int* result;
  162. };
  163. typedef struct {
  164.   int argc;
  165.   char** argv;
  166. } Robot_params;
  167.  
  168. // Lancement du miroir
  169. BOOL LaunchMirror();
  170.  
  171.  
  172. #define NStatsBuffer                    14
  173.  
  174.  
  175. /////////////////////////////////////////////////////////////////////////////
  176. // CShellApp:
  177. // See Shell.cpp for the implementation of this class
  178. //
  179. //class CShellApp : public CWinApp
  180. class CShellApp
  181. {
  182. public:
  183.     CShellApp();
  184.   void init_lance();
  185.   CString end_path;
  186.   CString end_path_complete;
  187.   /*
  188.   int suivant0(void);
  189.   int suivant1(void);
  190.   int suivant2(void);
  191.   //int suivant3(void);
  192.   int suivant4(void);
  193.   */
  194.   void OptPannel();
  195.  
  196.   //BOOL InitInstance();
  197.   
  198.   /*
  199. // Overrides
  200.     // ClassWizard generated virtual function overrides
  201.     //{{AFX_VIRTUAL(CShellApp)
  202.     public:
  203.     virtual BOOL InitInstance();
  204.     //}}AFX_VIRTUAL
  205.  
  206. // Implementation
  207.  
  208.     //{{AFX_MSG(CShellApp)
  209.     afx_msg void OnAppAbout();
  210.         // NOTE - the ClassWizard will add and remove member functions here.
  211.         //    DO NOT EDIT what you see in these blocks of generated code !
  212.     //}}AFX_MSG
  213.     DECLARE_MESSAGE_MAP()
  214.   */
  215. };
  216.  
  217.  
  218. /////////////////////////////////////////////////////////////////////////////
  219.  
  220. //{{AFX_INSERT_LOCATION}}
  221. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  222.  
  223. #endif // !defined(AFX_SHELL_H__ED81E637_E017_11D1_A97E_006097BC6150__INCLUDED_)
  224.